Before conducting imputations, I excluded participants who said their sexual preferences were for “both” genders or the same gender (n = 76). I further excluded people who did not identify as black or coloured (n = 7) and people who did not report partners in the previous year (n = 170). Participants who had missing observations on those characteristics were left in the dataset. This left 1074 relationships reported by 647 participants. Of those relationships 400 started in the 12 months preceeding the survey. I imputed 50 datasets using the random forest method for continuous and nominal categorical variables and the “polr” method for our ordinal variables.
Figure 6. Distribution of bridge widths for each imputed dataset, by sex and HIV status
Overall, among men the expected count of bridge widths for those with HIV was 1.6 times higher than those who were HIV negative. Among women it was 2.67 times higher.
cfhivfig <- cfmodcoef %>%
filter(term == "hivPositive") %>%
ggplot(aes(x = .imp, or)) +
geom_hline(yintercept = 0,
color = "blue") +
geom_point() +
geom_pointrange(aes(ymax = orupr,
ymin = orlwr)) +
facet_grid(sex ~ .) +
xlab("Imputation") +
ylab("OR") +
theme
cfhivfig
cfagefig <- cfmodpredage %>%
ggplot(aes(x = age, y = pred, group = .imp)) +
geom_line() +
facet_grid(. ~ sex) +
xlab("Age") +
ylab("Probability") +
theme
cfagefig
cfagediffig <- cfmodpredagedif %>%
ggplot(aes(x = agedif, y = pred, group = .imp)) +
geom_line() +
facet_grid(. ~ sex) +
xlab("Age") +
ylab("Probability") +
theme
cfagediffig
mcphivfig <- mcpmodcoef %>%
filter(term == "hivPositive" &
.imp != 34) %>%
ggplot(aes(x = .imp, or)) +
geom_hline(yintercept = 0,
color = "blue") +
geom_point() +
geom_pointrange(aes(ymax = orupr,
ymin = orlwr)) +
facet_grid(sex ~ .) +
xlab("Imputation") +
ylab("OR") +
theme
mcphivfig
mcpagefig <- mcpmodpredage %>%
ggplot(aes(x = age, y = pred, group = .imp)) +
geom_line() +
facet_grid(. ~ sex) +
xlab("Age") +
ylab("Probability") +
theme
mcpagefig
mcpagediffig <- mcpmodpredagedif %>%
ggplot(aes(x = agedif, y = pred, group = .imp)) +
geom_line() +
facet_grid(. ~ sex) +
xlab("Age") +
ylab("Probability") +
theme
mcpagediffig